package com.ctshk.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;

/**
 * TRAVEl_OUTTRA(102, "行程管理-行程审批(出境遊)"), XXX-YYY(ZZZ)
 * XXX为模块,YYY为审批类型,zzz为业务类型
 *
 * @author 谢诗宏
 * @description 审批流程类型
 * @date 2021/3/11
 */
@AllArgsConstructor
public enum SysApprovalType {
    TRAVEl_OUTTRA(102, "行程管理-行程审批(出境遊)", false),
    GROUP_OUTTRA(103, "旅行團管理-完團審批(出境遊)", false),
    CHASE_OUTTRA(105, "旅行團-追位審批(出境遊)", false),
    DISCOUNT_OUTTRA(106, "訂單操作-折扣審批(出境遊)", false),
    REFUND_OUTTRA(107, "訂單操作-退款審批(出境遊)", false),
    LEAVE_OUTTRA(108, "訂單操作-退團審批(出境遊)", false),
    AIR_OUTTRA(125, "新增機票預訂審批(出境遊)", true),
    TRAIN_OUTTRA(126, "新增火車票預訂審批(出境遊)", true),
    SHIP_OUTTRA(127, "新增船票預訂審批(出境遊)", true),
    CAR_OUTTRA(128, "新增租車預訂審批(出境遊)", true),
    FOOD_OUTTRA(129, "新增餐飲預訂審批(出境遊)", true),
    HOTEL_OUTTRA(130, "新增酒店預訂審批(出境遊)", true),
    OTHER_OUTTRA(131, "新增綜費預訂審批(出境遊)", true),
    TICKET_OUTTRA(132, "新增門票預訂審批(出境遊)", true),
    TRAVEl_INTRA(202, "行程管理-行程审批(入境遊)", false),
    GROUP_INTRA(203, "旅行團管理-完團審批(入境遊)", false),
    CHASE_INTRA(205, "旅行團-追位審批(入境遊)", false),
    DISCOUNT_INTRA(206, "訂單操作-折扣審批(入境遊)", false),
    REFUND_INTRA(207, "訂單操作-退款審批(入境遊)", false),
    LEAVE_INTRA(208, "訂單操作-退團審批(入境遊)", false),
    AIR_INTRA(225, "新增機票預訂審批(入境遊)", true),
    TRAIN_INTRA(226, "新增火車票預訂審批(入境遊)", true),
    SHIP_INTRA(227, "新增船票預訂審批(入境遊)", true),
    CAR_INTRA(228, "新增租車預訂審批(入境遊)", true),
    FOOD_INTRA(229, "新增餐飲預訂審批(入境遊)", true),
    HOTEL_INTRA(230, "新增酒店預訂審批(入境遊)", true),
    OTHER_INTRA(231, "新增綜費預訂審批(入境遊)", true),
    TICKET_INTRA(232, "新增門票預訂審批(入境遊)", true),
    TRAVEl_OUTCUSTOM(304, "團期管理-完團審批(出境定制)", false),
    DISCOUNT_OUTCUSTOM(306, "訂單操作-折扣審批(出境定制)", false),
    REFUND_OUTCUSTOM(307, "訂單操作-退款審批(出境定制)", false),
    LEAVE_OUTCUSTOM(308, "訂單操作-退團審批(出境定制)", false),
    AIR_OUTCUSTOM(325, "新增機票預訂審批(出境定制)", true),
    TRAIN_OUTCUSTOM(326, "新增火車票預訂審批(出境定制)", true),
    SHIP_OUTCUSTOM(327, "新增船票預訂審批(出境定制)", true),
    CAR_OUTCUSTOM(328, "新增租車預訂審批(出境定制)", true),
    FOOD_OUTCUSTOM(329, "新增餐飲預訂審批(出境定制)", true),
    HOTEL_OUTCUSTOM(330, "新增酒店預訂審批(出境定制)", true),
    OTHER_OUTCUSTOM(331, "新增綜費預訂審批(出境定制)", true),
    TICKET_OUTCUSTOM(332, "新增門票預訂審批(出境定制)", true),
    GROUP_INCUSTOM(404, "團期管理-完團審批(入境定制)", false),
    DISCOUNT_INCUSTOM(406, "訂單操作-折扣審批(入境定制)", false),
    REFUND_INCUSTOM(407, "訂單操作-退款審批(入境定制)", false),
    LEAVE_INCUSTOM(408, "訂單操作-退團審批(入境定制)", false),
    AIR_INCUSTOM(425, "新增機票預訂審批(入境定制)", true),
    TRAIN_INCUSTOM(426, "新增火車票預訂審批(入境定制)", true),
    SHIP_INCUSTOM(427, "新增船票預訂審批(入境定制)", true),
    CAR_INCUSTOM(428, "新增租車預訂審批(入境定制)", true),
    FOOD_INCUSTOM(429, "新增餐飲預訂審批(入境定制)", true),
    HOTEL_INCUSTOM(430, "新增酒店預訂審批(入境定制)", true),
    OHTER_INCUSTOM(431, "新增綜費預訂審批(入境定制)", true),
    TICKET_INCUSTOM(432, "新增門票預訂審批(入境定制)", true),
    GROUP_CONFERENCE(504, "團期管理-完團審批(會議會獎)", false),
    DISCOUNT_CONFERENCE(506, "訂單操作-折扣審批(會議會獎)", false),
    REFUND_CONFERENCE(507, "訂單操作-退款審批(會議會獎)", false),
    LEAVE_CONFERENCE(508, "訂單操作-退團審批(會議會獎)", false),
    AIR_CONFERENCE(525, "新增機票預訂審批(會議會獎)", true),
    TRAIN_CONFERENCE(526, "新增火車票預訂審批(會議會獎)", true),
    SHIP_CONFERENCE(527, "新增船票預訂審批(會議會獎)", true),
    CAR_CONFERENCE(528, "新增租車預訂審批(會議會獎)", true),
    FOOD_CONFERENCE(529, "新增餐飲預訂審批(會議會獎)", true),
    HOTEL_CONFERENCE(530, "新增酒店預訂審批(會議會獎)", true),
    OTHER_CONFERENCE(531, "新增綜費預訂審批(會議會獎)", true),
    TICKET_CONFERENCE(532, "新增門票預訂審批(會議會獎)", true),
    ADD_FIXED(601, "资源中心-新增產品審批(固定套票)", false),
    CANCEL_FIXED(609, "操作訂單-取消訂單審批(固定套票)", false),
    ADD_HOTEL(801, "资源中心-新增產品審批(酒店)", false),
    CANCEL_HOTEL(809, "操作訂單-取消訂單審批(酒店)", false),
    ADD_AIR(901, "资源中心-新增產品審批(機票)", false),
    CANCEL_AIR(909, "操作訂單-取消訂單審批(機票)", false),
    ADD_TRAIN(1001, "资源中心-新增產品審批(火車票)", false),
    CANCEL_TRAIN(1009, "操作訂單-取消訂單審批(火車票)", false),
    ADD_SHIP(1101, "资源中心-新增產品審批(船票)", false),
    CANCEL_SHIP(1109, "操作訂單-取消訂單審批(船票)", false),
    ADD_BUS(1201, "资源中心-新增產品審批(巴士票)", false),
    CANCEL_BUS(1209, "操作訂單-取消訂單審批(巴士票)", false),
    ADD_AIREXPRESS(1301, "资源中心-新增產品審批(機場快線)", false),
    CANCEL_AIREXPRESS(1309, "操作訂單-取消訂單審批(機場快線)", false),
    ADD_TICKET(1401, "资源中心-新增產品審批(景點門票)", false),
    CANCEL_TICKET(1409, "操作訂單-取消訂單審批(景點門票)", false),
    ADD_LOCALFUN(1501, "资源中心-新增產品審批(當地玩樂)", false),
    CANCEL_LOCALFUN(1509, "操作訂單-取消訂單審批(當地玩樂)", false),
    ADD_VISA(1601, "资源中心-新增產品審批(簽證)", false),
    CANCEL_VISA(1609, "操作訂單-取消訂單審批(簽證)", false),
    ADD_CERTIFICATE(1701, "资源中心-新增產品審批(證件辦理)", false),
    CANCEL_CERTIFICATE(1709, "操作訂單-取消訂單審批(證件辦理)", false),
    ADD_COMMODITY(1801, "资源中心-新增產品審批(商品)", false),
    CANCEL_COMMODITY(1809, "操作訂單-取消訂單審批(商品)", false),

    PAYMENT_FINANCE(1912, "预收管理-申請預收款審批(财务中心)", false),
    REFUND_PAYMENT_FINANCE(1913, "申请退预收-申請退預收審批(财务中心)", false),
    RECOGNITION_FINANCE(1914, "认款管理-認款審批(财务中心)", false),
    PAIRS_FINANCE(1915, "客户对账-客戶對賬審批(财务中心)", false),
    CLIENT_ONACC_FINANCE(1916, "大客户/代理商-申請掛賬審批(财务中心)", true),
    CANCELACC_CANCELACC_FINANCE(1917, "销账-申請銷賬審批(财务中心)", false),
    IN_ONACC_FINANCE(1918, "内部挂账-申請掛賬審批(财务中心)", true),
    IN_CANCELACC_FINANCE(1919, "内部挂账-申請销账審批(财务中心)", false),
    GROUPCLIENT_CANCELACC_FINANCE(1920, "集团客户-申请销账审批(财务中心)", false),
    PAYMENT_PAYMENT_FINANCE(1921, "特殊收款管理-申請特殊收款審批(财务中心)", true),
    PREPAID_FINANCE(1922, "预付管理-申請預付審批(财务中心)", true),
    SUPPLIERPAIRS_FINANCE(1923, "供应商对账-申請供應商對賬審批(财务中心)", false),
    REALPAYMENT_FINANCE(1924, "供应商实付-申請實付審批(财务中心)", true),

    PROMOTION_OPRATION(2010, "推广码-新增推廣碼審批(運營中心)", false),
    BANKOFFERS_OPRATION(2011, "推广码-新增銀行優惠審批(運營中心)", false),
    ADDSUPPLIER_SYSTEM(2233, "供应商管理-新增供應商(系統資源)", false),
    ADDAGENT_SYSTEM(2234, "代理商管理-新增代理商(系統資源)", false),
    ADDCLIENT_SYSTEM(2235, "大客户管理-新增大客戶(系統資源)", false),
    ;

    @Getter
    @Setter
    private int code;

    @Getter
    @Setter
    private String value;

    // 是否涉及金额区间判断
    @Getter
    @Setter
    private boolean condition;

    public static String parseValue(int code) {
        for (SysApprovalType type : SysApprovalType.values()) {
            if (type.code == code) {
                return type.getValue();
            }
        }
        return null;
    }
}
